<?php
namespace app;
/**
 * 
 * 导航
 * 
 * */
class NavComponent {

	public function __construct() {

	}

	public static function render() {
		$result = '
			<nav class="navbar navbar-dark bg-primary navbar navbar-expand-lg">
			    <a class="navbar-brand" href="#">学生管理系统</a>
			    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
			        <span class="navbar-toggler-icon"></span>
			    </button>
			    <div class="collapse navbar-collapse" id="navbarNavDropdown">
			        <ul class="navbar-nav">
			            <li class="nav-item';
		$result .= $_SERVER['SCRIPT_NAME'] === '/index.php' ? ' active' : '';
		$result .= '
						">
			                <a class="nav-link" href="/index.php">首页 <span class="sr-only">(current)</span></a>
			            </li>
			            <li class="nav-item';
		$result .= $_SERVER['SCRIPT_NAME'] === '/user/index.php' ? ' active' : '';	            

		$result .= 	    '">
			                <a class="nav-link" href="/user/index.php">用户管理</a>
			            </li>
			            <li class="nav-item';
		$result .= $_SERVER['SCRIPT_NAME'] === '/clazz' ? ' active' : '';	            

		$result .= 	    '">
			                <a class="nav-link" href="/clazz/index">班级管理</a>
			            </li>
			        </ul>
			    </div>
			    <form class="form-inline my-2 my-lg-0">
			          <a style="color: white;" href="/logout.controller.php">退出</a>
			    </form>
			</nav>
		';
		return $result;
	}

}